package com.flismax.mysms.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

import com.flismax.mysms.R;
import com.flismax.mysms.util.Key;
import com.flismax.mysms.util.MyPreferenceII;

public class ReceiverSmsActivity extends Activity implements
		OnCheckedChangeListener {

	private CheckBox abortCheckBox;
	private MyPreferenceII preference;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_receiver_sms);

		abortCheckBox = (CheckBox) findViewById(R.id.abortCheckBox);
		abortCheckBox.setOnCheckedChangeListener(this);

		preference = MyPreferenceII.getInstance(this);

		abortCheckBox.setChecked(preference
				.getBoolean(Key.ABORT_MESSAGE, false));
	}

	public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
		preference.putBoolean(Key.ABORT_MESSAGE, isChecked);
	}

}
